package cn.edu.scau.cmi.shishuai.exercise5;

public class ConsoleClient_AfterClass_9 {
	public static void main(String[] args) {
		BB b1 = new BB(), b2 = new BB();
		b1.setN(3);
		b2.setN(5);
		int s1 = b1.getSum();
		int s2 = b2.getSum();
		System.out.println(s1 + s2);
	}
}

class BB {
	int n;
	static int sum = 0;
	void setN(int n) {
		this.n = n;
	}
	int getSum() {
		for (int i = 1; i <= n; i++) {
			sum += i;
		}
		return sum;
	}
}